package com.hznu.jspFinal.service;

import com.hznu.jspFinal.dao.UserTypeMapper;
import com.hznu.jspFinal.entity.UserType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author jamesZhan
 */
@Service
public class UserTypeServiceImpl implements UserTypeService {
    @Autowired
    private UserTypeMapper userTypeMapper;

    @Override
    public void insert(UserType userType) {
        userTypeMapper.insert(userType);
    }

    @Override
    public void delete(Integer id) {
        userTypeMapper.deleteByPrimaryKey(id);
    }

    @Override
    public UserType select(Integer id) {
        return userTypeMapper.selectByPrimaryKey(id);
    }

    @Override
    public void update(UserType userType) {
        userTypeMapper.updateByPrimaryKeySelective(userType);
    }

    @Override
    public List<UserType> selectAll() {
        return userTypeMapper.selectAll();
    }
}
